package edu.hawaii.wattdepotapps;

import org.apache.wicket.Application;
import org.apache.wicket.Page;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.request.target.coding.HybridUrlCodingStrategy;
import edu.hawaii.wattdepotapps.home.WattDepotAppsPage;
import edu.hawaii.wattdepotapps.visualizer.VisualizationPage;
import edu.hawaii.wattdepotapps.browser.BrowserPage;
import edu.hawaii.wattdepotapps.monitor.MonitorPage;

/**
 * Class required to specify WattDepotApps web applications. Mounts the visualizer, home, browser
 * (not yet implemented), and monitor pages for nice URLs. Sets the home page as WattDepotAppsPage
 * and application mode.
 * 
 * @author Edward Meyer, Kendyll Doi, Bao Huy Ung
 * @version 2.0
 */
public class WattDepotApplications extends WebApplication {
  /**
   * Initialize for this web application. Mounts the various pages for nice URLs.
   * 
   */
  @Override
  public void init() {
    mountBookmarkablePage("/visualizer", VisualizationPage.class);
    mountBookmarkablePage("/home", WattDepotAppsPage.class);
    mountBookmarkablePage("/browser", BrowserPage.class);
    // mountBookmarkablePage("/monitor", MonitorPage.class);
    mount((new HybridUrlCodingStrategy("/monitor", MonitorPage.class, true)));

  }

  /**
   * Returns WattDepotAppsPage as the home page for this web application.
   * 
   * @return The home page.
   */
  @Override
  public Class<? extends Page> getHomePage() {
    return WattDepotAppsPage.class;
  }

  /**
   * Returns the application mode, either as Development or Deployment.
   * 
   * @return Application mode.
   */
  @Override
  public String getConfigurationType() {
    return Application.DEVELOPMENT;
  }
}